package com.lucenly.spell.fragment

import android.view.LayoutInflater
import android.view.ViewGroup
import com.lucenly.spell.R
import com.lucenly.spell.activity.*
import com.lucenly.spell.base.BaseFragment
import com.lucenly.spell.databinding.FragmentMyBinding
import com.lucenly.spell.view.dialog.ContactDialog
import com.moregold.mvvmlib.ext.ext_doubleClick
import com.moregold.mvvmlib.ext.startActivity

class MyFragment : BaseFragment<FragmentMyBinding>(R.layout.fragment_my) {
    override fun getViewBinding(
        inflater: LayoutInflater,
        container: ViewGroup?
    ): FragmentMyBinding {
        return FragmentMyBinding.inflate(inflater)
    }

    override fun initData() {
    }

    override fun initEvent() {
        binding.tvBecome.ext_doubleClick {
            startActivity<BecomeActivity>()
        }
        binding.ivMsg.ext_doubleClick {
            startActivity<MessageActivity>()
        }
        binding.tvBill.ext_doubleClick {
            startActivity<MyBillActivity>()
        }
        binding.tvBillCenter.ext_doubleClick {
            startActivity<BillCenterActivity>()
        }
        binding.llInvitation.ext_doubleClick {
            startActivity<EditInvitationActivity>()
        }
        binding.ivSet.ext_doubleClick {
            startActivity<SettingActivity>()
        }
        binding.llSetting.ext_doubleClick {
            startActivity<SettingActivity>()
        }
        binding.tvAllOrder.ext_doubleClick {
            startActivity<OrderActivity>()
        }
        binding.clUnPay.ext_doubleClick {
            startActivity<OrderActivity>("page" to 2)
        }
        binding.clUnSend.ext_doubleClick {
            startActivity<OrderActivity>("page" to 3)
        }
        binding.clUnReciver.ext_doubleClick {
            startActivity<OrderActivity>("page" to 4)
        }
        binding.clFinish.ext_doubleClick {
            startActivity<OrderActivity>("page" to 5)
        }
        binding.llAdrss.ext_doubleClick {
            startActivity<AdressListActivity>()
        }
        binding.llContact.ext_doubleClick {
            val dialog = ContactDialog(activity!!,0)
            dialog.show()
        }
        binding.llJoin.ext_doubleClick {
            val dialog = ContactDialog(activity!!,1)
            dialog.show()
        }
        binding.llNewPeopel.ext_doubleClick {
            startActivity<PeopleGuideActivity>()
        }
    }

    override fun startObserve() {
    }
}